From 1368339066dd94f7aa949781d70e11052b9df7c8 Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Thu, 5 Aug 2004 16:13:28 +0000 Subject: [PATCH] bitkeeper revision 1.1149.2.2 (41125ca87nJjUEYoSsWzlx9ToYbRuA) Put some memory into the DMA zone. Makes memory allocation for drivers using a coherent_dma_mask happy. --- linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c index 779a25073d..339da5061e 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c +++ b/linux-2.6.7-xen-sparse/arch/xen/i386/mm/init.c @@ -422,15 +422,21 @@ void zap_low_mappings (void) void __init zone_sizes_init(void) { unsigned long zones_size[MAX_NR_ZONES] = {0, 0, 0}; - unsigned int high, low; + unsigned int max_dma, high, low; + max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT; low = max_low_pfn; high = highend_pfn; - zones_size[ZONE_NORMAL] = low; + if (low < max_dma) + zones_size[ZONE_DMA] = low; + else { + zones_size[ZONE_DMA] = max_dma; + zones_size[ZONE_NORMAL] = low - max_dma; #ifdef CONFIG_HIGHMEM - zones_size[ZONE_HIGHMEM] = high - low; + zones_size[ZONE_HIGHMEM] = high - low; #endif + } free_area_init(zones_size); } #else -- 2.30.2